package tw.com.book.componet;

public class IssueBussinessException extends RuntimeException {
	private final static String MESSAGE = "[%s]%s\n%s";
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String message = "";
	private String excode = "";
	private String exMessage = "";

	public IssueBussinessException(Msg msg, String message) {

		this.message = message;
		this.excode = msg.code;
		this.exMessage = msg.message;
	}

	public IssueBussinessException(Msg exCode) {
		this(exCode, "");
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public String getExMessage() {
		return exMessage;
	}

	public void setExMessage(String exMessage) {
		this.exMessage = exMessage;
	}

	public String getExcode() {
		return excode;
	}

	public void setExcode(String excode) {
		this.excode = excode;
	}

	@Override
	public String toString() {
		return String
				.format(MESSAGE, this.excode, this.exMessage, this.message);
	}

}
